<?php

include dirname(dirname(__FILE__)) . '/include/common.php';

class webServiceGetUser extends core {

    public function process() {
        $user_id = intval($_POST['user_id']);
        $email = $this->_cleanEmail($_POST['email']);
        $data = $this->db->get_row("SELECT * FROM users WHERE `id`='$user_id' AND email='$email'");

        if ($data) {
           
            $this->_JSONResponse(array('error' => 0, 'fn' => $data->first_name, 
                'ln' => $data->last_name,
                'fiance_fn' => $data->fiance_first_name,
                'fiance_ln' => $data->fiance_last_name,
                'fiance_date' => date('Y-m-d',strtotime($data->wedding_date)) 
                ));
        } else {
            $this->_JSONResponse(array('error' => 1,'msg'=>'User does not exist'));
        }
    }

}

$processor = new webServiceGetUser();
$processor->process();
?>